package com.shelpe.services.sustainer.repository.jpa;

import java.util.List;

import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;

import com.shelpe.services.sustainer.entity.jpa.AutoProductQueue;

public interface AutoProductQueueRepository extends CrudRepository<AutoProductQueue, AutoProductQueue.QueuePK>{

	List<AutoProductQueue> findByStatus(AutoProductQueue.Status status);
	AutoProductQueue findByStatus(AutoProductQueue.Status status, Sort sort);
	AutoProductQueue findByStatusAndProgress(AutoProductQueue.Status status, int progress, Sort sort);
	AutoProductQueue findByCampaignIDAndStatus(long campaignID, AutoProductQueue.Status status, Sort sort);
	
	int countByCampaignIDAndStatus(long campaignID, AutoProductQueue.Status status);
	int countByCampaignIDAndStatusAndProgress(long campaignID, AutoProductQueue.Status status, int progress);
}
